//**********************************************************
//    File Name: LOG.cs
//    Author: Team Motif
//    Date Created : 04/13/2007
//    Current Owner: Team Motif 
//                                                                            
//    Purpose: 
//    This class is used to record error messages and exception in an application
//    log.
//
//	  Copyright 2007
//**********************************************************

using System;
using System.Collections.Generic;
using System.Text;

namespace Library
{
    public class LOG
    {
        /// <summary>
        /// -------------------------------------------------------------------------------
        /// Prints debug priority statement
        /// -------------------------------------------------------------------------------
        /// </summary>
        /// <param name="err"></param>
        static public void debug(string err)
        {
            System.Object lockThis = new System.Object();
            lock (lockThis)
            {
                DateTime time = DateTime.UtcNow;
                write(time.ToString() + " :: DEBUG: " + err);
            }            
        }

        /// <summary>
        /// -------------------------------------------------------------------------------
        /// Prints error priority statements
        /// -------------------------------------------------------------------------------
        /// </summary>
        /// <param name="err"></param>
        static public void error(string err)
        {
            System.Object lockThis = new System.Object();
            lock (lockThis)
            {
                DateTime time = DateTime.UtcNow;
                write(time.ToString() + " :: ERROR: " + err);
            }
        }

        /// <summary>
        /// -------------------------------------------------------------------------------
        /// Prints notice priority statement
        /// -------------------------------------------------------------------------------
        /// </summary>
        /// <param name="err"></param>
        static public void notice(string err)
        {
            System.Object lockThis = new System.Object();
            lock (lockThis)
            {
                DateTime time = DateTime.UtcNow;
                write(time.ToString() + " :: NOTICE: " + err);
            }
        }

        /// <summary>
        /// -------------------------------------------------------------------------------
        /// Prints critical statements
        /// -------------------------------------------------------------------------------
        /// </summary>
        /// <param name="err"></param>
        static public void critical(string err)
        {
            System.Object lockThis = new System.Object();
            lock (lockThis)
            {
                DateTime time = DateTime.UtcNow;
                write(time.ToString() + " :: CRITICAL: " + err);
            }
        }

        /// <summary>
        /// -------------------------------------------------------------------------------
        /// Private write line method
        /// -------------------------------------------------------------------------------
        /// </summary>
        /// <param name="err"></param>
        static private void write(string err)
        {
            Console.WriteLine(err);
        }

    }
}
